//
//  DefaultScrollView.m
//  NewPro
//
//  Created by 何荧红 on 2018/10/10.
//  Copyright © 2018 何荧红. All rights reserved.
//

#import "DefaultScrollView.h"
#import "ScanIdList.h"
#import "ScanIdModel.h"

@interface DefaultScrollView ()
@property (nonatomic, strong) UIImageView *cardimg;
@property (nonatomic, strong) UITextField *sextitle;
@property (nonatomic, strong) UITextField *cardtitle;
@property (nonatomic, strong) UITextField *timetitle;

@property (nonatomic, strong) UIView *MyPOSline;


@property (nonatomic, strong) UIButton *mybutton;

@end

@implementation DefaultScrollView
- (instancetype)initWithTraditionSec{
    self = [super init];
    if (self) {
        self.backgroundColor = [UIColor clearColor];
        self.frame = CGRectMake(0, - 1000, SCREEN_WIDTH, SCREEN_HEIGHT - iPhoneX_Top - 100);
        self.showsVerticalScrollIndicator = NO;
        self.showsHorizontalScrollIndicator = NO;
        self.contentSize = CGSizeMake(SCREEN_WIDTH, 645);
        [self CleanTraditionSecView];
    }
    return self;
}
- (void)setVCArr:(NSArray *)VCArr{
    _VCArr = VCArr;
    if (_VCArr.count > 0) {
     
        
        
    }
}

- (instancetype)initWithMyPOSBG{
    self = [super init];
    if (self) {
        self.backgroundColor = [UIColor clearColor];
        self.showsVerticalScrollIndicator = NO;
        self.showsHorizontalScrollIndicator = NO;
        self.contentSize = CGSizeMake(SCREEN_WIDTH * 6, 0);
        self.pagingEnabled = YES;
        self.bounces = NO;
    }
    return self;
}
- (instancetype)initWithMyPOSHeader{
    self = [super init];
    if (self) {
        self.backgroundColor = [UIColor whiteColor];
        self.frame = CGRectMake(0, iPhoneX_Top, SCREEN_WIDTH, 44);
        self.showsVerticalScrollIndicator = NO;
        self.showsHorizontalScrollIndicator = NO;
        self.contentSize = CGSizeMake(SCREEN_WIDTH/5 * 6, 44);
        self.pagingEnabled = YES;
        self.scrollEnabled = NO;
        [self CreateWithMyPOSHeader];
    }
    return self;
}
- (void)CreateWithMyPOSHeader{
    NSArray *arr = @[@"未激活",@"审核中",@"审核失败",@"已开通",@"已激活",@"已达标"];
    for (NSInteger i = 0; i < arr.count; i++) {
        UIButton *button = [[UIButton alloc]initWithFrame:CGRectMake((SCREEN_WIDTH/5) * i, 0, SCREEN_WIDTH/5, 44)];
        [button addTarget:self action:@selector(POSHeaderClik:) forControlEvents:UIControlEventTouchUpInside];
        button.tag = 3454 + i;
        button.titleLabel.font = [UIFont fontWithName:@"PingFang-SC-Medium" size:12];
        [button setTitle:arr[i] forState:UIControlStateNormal];
        [button setTitleColor:[UIColor colorWithHexString:@"999999"] forState:UIControlStateNormal];
        if (i == 0) {
            [button setTitleColor:[UIColor colorWithHexString:@"0CA6F0"] forState:UIControlStateNormal];
            self.mybutton = button;
        }
        [self addSubview:button];
    }
    self.MyPOSline = [[UIView alloc]initWithFrame:CGRectMake(0, 42, SCREEN_WIDTH/5, 2)];
    self.MyPOSline.backgroundColor = [UIColor colorWithHexString:@"0CA6F0"];
    [self addSubview:self.MyPOSline];
    
    UIPanGestureRecognizer *pan = [[UIPanGestureRecognizer alloc]initWithTarget:self action:@selector(panAction:)];
    [self addGestureRecognizer:pan];
}
- (void)panAction:(UIPanGestureRecognizer *)pan{
    if (pan.state == UIGestureRecognizerStateChanged) {
        [self commitTranslation:[pan translationInView:self]];
    }
    if (pan.state == UIGestureRecognizerStateEnded) {
        [self ChangeScrollView:self.isNext];
    }
}
/** 判断手势方向  */
- (void)commitTranslation:(CGPoint)translation {
    CGFloat absX = fabs(translation.x);
    CGFloat absY = fabs(translation.y);
    // 设置滑动有效距离
    if (MAX(absX, absY) < 10)
        return;
    if (absX > absY ) {
        if (translation.x<0) {//向左滑动
            self.isNext = YES;
        }else{//向右滑动
            self.isNext = NO;
        }
    }
}
- (void)ChangeScrollView:(BOOL)isNext{
    if (isNext) {
        UIButton *next = [self viewWithTag:self.mybutton.tag + 1];
        [self POSHeaderClik:next];
    }else{
        UIButton *next = nil;
        NSMutableArray *buttonArr = [[NSMutableArray alloc]init];
        for (UIView *subview in self.subviews) {
            if ([subview isKindOfClass:[UIButton class]]) {
                UIButton *subbtn = (UIButton *)subview;
                [buttonArr addObject:subbtn];
            }
        }
        NSInteger btnMinTag = self.mybutton.tag;
        NSInteger btnMaxTag = self.mybutton.tag;
        for (NSInteger i = 0; i < buttonArr.count; i++) {
            UIButton *but = buttonArr[i];
            if (but.tag < btnMinTag) {
                btnMinTag = but.tag;
            }
            if (but.tag > btnMaxTag) {
                btnMaxTag = but.tag;
            }
        }
        if (self.mybutton.tag > btnMinTag) {
            next = [self viewWithTag:self.mybutton.tag - 1];
        }else{
            next = [self viewWithTag:btnMaxTag];
        }
        [self POSLeftClik:next];
    }
}
- (void)POSLeftClik:(UIButton *)button{
    self.mybutton = button;
    self.MyPOSline.frame = CGRectMake(- (SCREEN_WIDTH/5), 42, SCREEN_WIDTH/5, 2);
    [self ScrollViewRestore];
    NSArray *arr = @[@"未激活",@"审核中",@"审核失败",@"已开通",@"已激活",@"已达标"];
    for (NSInteger i = 0; i < arr.count; i++) {
        if ([self.mybutton.titleLabel.text isEqualToString:arr[i]]) {
            if (self.ClikButtonIndexBlock) self.ClikButtonIndexBlock(i);
        }
    }
    NSMutableArray *buttonarr = [[NSMutableArray alloc]init];
    for (UIView *sub in self.subviews) {
        if ([sub isKindOfClass:[UIButton class]]) {
            UIButton *subbtn = (UIButton *)sub;
            if (subbtn .tag == button.tag) {
                [subbtn setTitleColor:[UIColor colorWithHexString:@"0CA6F0"] forState:UIControlStateNormal];
            }else{
                [subbtn setTitleColor:[UIColor colorWithHexString:@"999999"] forState:UIControlStateNormal];
            }
            [buttonarr addObject:subbtn];
        }
    }
    [self setContentOffset:CGPointMake(-(SCREEN_WIDTH/5), 0) animated:YES];
    [self ChangeFrameLeft:buttonarr];
}
- (void)POSHeaderClik:(UIButton *)button{
    self.mybutton = [self viewWithTag:self.mybutton.tag + 1];
    [self ScrollViewRestore];
    NSArray *arr = @[@"未激活",@"审核中",@"审核失败",@"已开通",@"已激活",@"已达标"];
    for (NSInteger i = 0; i < arr.count; i++) {
        if ([self.mybutton.titleLabel.text isEqualToString:arr[i]]) {
            if (self.ClikButtonIndexBlock) self.ClikButtonIndexBlock(i);
        }
    }
    NSMutableArray *buttonarr = [[NSMutableArray alloc]init];
    for (UIView *sub in self.subviews) {
        if ([sub isKindOfClass:[UIButton class]]) {
            UIButton *subbtn = (UIButton *)sub;
            if (subbtn .tag == self.mybutton.tag) {
                [subbtn setTitleColor:[UIColor colorWithHexString:@"0CA6F0"] forState:UIControlStateNormal];
            }else{
                [subbtn setTitleColor:[UIColor colorWithHexString:@"999999"] forState:UIControlStateNormal];
            }
            [buttonarr addObject:subbtn];
        }
    }
    [self ChangeFrameWith:buttonarr];
}
- (void)ChangeFrameLeft:(NSArray *)arr{
    NSMutableArray *big = [[NSMutableArray alloc]init];
    NSMutableArray *small = [[NSMutableArray alloc]init];
    for (NSInteger i = 0; i < arr.count; i++) {
        UIButton *sub = arr[i];
        if (sub.frame.origin.x >= self.mybutton.frame.origin.x) {
            [big addObject:sub];
        }else if (sub.frame.origin.x < self.mybutton.frame.origin.x){
            [small addObject:sub];
        }
    }
    for (NSInteger i = 0; i < big.count; i++) {
        UIButton *con = nil;
        UIButton *sm = big[i];
        for (NSInteger j = i + 1; j < big.count; j++) {
            UIButton *index = big[j];
            if (sm.frame.origin.x > index.frame.origin.x) {
                con = sm;
                sm = index;
                [big replaceObjectAtIndex:j withObject:con];;
            }
        }
        [big replaceObjectAtIndex:i withObject:sm];
    }
    for (NSInteger i = 0; i < small.count; i++) {
        UIButton *con = nil;
        UIButton *sm = small[i];
        for (NSInteger j = i + 1; j < small.count; j++) {
            UIButton *index = small[j];
            if (sm.frame.origin.x > index.frame.origin.x) {
                con = sm;
                sm = index;
                [small replaceObjectAtIndex:j withObject:con];;
            }
        }
        [small replaceObjectAtIndex:i withObject:sm];
    }
    NSArray *subarr = [big arrayByAddingObjectsFromArray:small];
    for (NSInteger i = 0; i < subarr.count; i++) {
        UIButton *subbtn = subarr[i];
        subbtn.tag = self.mybutton.tag + i;
        subbtn.frame = CGRectMake(-(SCREEN_WIDTH/5) + (SCREEN_WIDTH/5 * i), 0, (SCREEN_WIDTH/5), 44);
    }
    NSLog(@"%f",self.contentOffset.x);
}
- (void)ChangeFrameWith:(NSArray *)arr{
    NSMutableArray *big = [[NSMutableArray alloc]init];
    NSMutableArray *small = [[NSMutableArray alloc]init];
    for (NSInteger i = 0; i < arr.count; i++) {
        UIButton *sub = arr[i];
        if (sub.frame.origin.x >= self.mybutton.frame.origin.x) {
            [big addObject:sub];
        }else if (sub.frame.origin.x < self.mybutton.frame.origin.x){
            [small addObject:sub];
        }
    }
    for (NSInteger i = 0; i < big.count; i++) {
        UIButton *con = nil;
        UIButton *sm = big[i];
        for (NSInteger j = i + 1; j < big.count; j++) {
            UIButton *index = big[j];
            if (sm.frame.origin.x > index.frame.origin.x) {
                con = sm;
                sm = index;
                [big replaceObjectAtIndex:j withObject:con];;
            }
        }
        [big replaceObjectAtIndex:i withObject:sm];
    }
    for (NSInteger i = 0; i < small.count; i++) {
        UIButton *con = nil;
        UIButton *sm = small[i];
        for (NSInteger j = i + 1; j < small.count; j++) {
            UIButton *index = small[j];
            if (sm.frame.origin.x > index.frame.origin.x) {
                con = sm;
                sm = index;
                [small replaceObjectAtIndex:j withObject:con];;
            }
        }
        [small replaceObjectAtIndex:i withObject:sm];
    }
    NSArray *subarr = [big arrayByAddingObjectsFromArray:small];
    for (NSInteger i = 0; i < subarr.count; i++) {
        UIButton *subbtn = subarr[i];
        subbtn.tag = self.mybutton.tag + i;
        subbtn.frame = CGRectMake((SCREEN_WIDTH/5) + (SCREEN_WIDTH/5 * i), 0, (SCREEN_WIDTH/5), 44);
    }
    [self setContentOffset:CGPointMake(SCREEN_WIDTH/5, 0) animated:YES];
    self.MyPOSline.frame = CGRectMake(SCREEN_WIDTH/5 , 42, SCREEN_WIDTH/5, 2);
}
- (void)ScrollViewRestore{
    if (self.mybutton.frame.origin.x == 0) {
        
    }else{
        NSMutableArray *big = [[NSMutableArray alloc]init];
        NSMutableArray *small = [[NSMutableArray alloc]init];
        for (UIView *subview in self.subviews) {
            if ([subview isKindOfClass:[UIButton class]]) {
                UIButton *subbtn = (UIButton *)subview;
                if (subbtn.frame.origin.x >= self.mybutton.frame.origin.x) {
                    [big addObject:subbtn];
                }else if (subbtn.frame.origin.x < self.mybutton.frame.origin.x){
                    [small addObject:subbtn];
                }
            }
        }
        for (NSInteger i = 0; i < big.count; i++) {
            UIButton *con = nil;
            UIButton *sm = big[i];
            for (NSInteger j = i + 1; j < big.count; j++) {
                UIButton *index = big[j];
                if (sm.frame.origin.x > index.frame.origin.x) {
                    con = sm;
                    sm = index;
                    [big replaceObjectAtIndex:j withObject:con];;
                }
            }
            [big replaceObjectAtIndex:i withObject:sm];
        }
        for (NSInteger i = 0; i < small.count; i++) {
            UIButton *con = nil;
            UIButton *sm = small[i];
            for (NSInteger j = i + 1; j < small.count; j++) {
                UIButton *index = small[j];
                if (sm.frame.origin.x > index.frame.origin.x) {
                    con = sm;
                    sm = index;
                    [small replaceObjectAtIndex:j withObject:con];;
                }
            }
            [small replaceObjectAtIndex:i withObject:sm];
        }
        NSArray *arr = @[@"未激活",@"审核中",@"审核失败",@"已开通",@"已激活",@"已达标"];
        NSInteger indexbtn = 0;
        for (NSInteger i = 0; i < arr.count; i++) {
            if ([self.SureButton.titleLabel.text isEqualToString:arr[i]]) {
                indexbtn = i;
            }
        }
        [self setContentOffset:CGPointMake(SCREEN_WIDTH/5 * indexbtn, 0)];
        NSArray *subarr = [big arrayByAddingObjectsFromArray:small];
        for (NSInteger i = 0; i < subarr.count; i++) {
            UIButton *subbtn = subarr[i];
            subbtn.tag = 3454 + i;
            subbtn.frame = CGRectMake((SCREEN_WIDTH/5 * i), 0, (SCREEN_WIDTH/5), 44);
        }
    }
}


- (void)setScanModelData{
    self.cardimg.image = [ScanIdList sharedInstance].scanModel.POSidFontImage;
    self.nametitle.text = [ScanIdList sharedInstance].scanModel.POSname;
    self.sextitle.text = [ScanIdList sharedInstance].scanModel.POSgender;
    self.cardtitle.text = [ScanIdList sharedInstance].scanModel.POScode;
    NSArray *arr = [[ScanIdList sharedInstance].scanModel.POSvalid componentsSeparatedByString:@"-"];
    NSString *dateOne = arr[0];
    NSString *dateTwo = arr[1];
    NSRange range = NSMakeRange(4, 2);
    NSString *str = @"";
    if ([dateTwo isEqualToString:@"长期"]) {
        str = [NSString stringWithFormat:@"%@.%@.%@-%@",[dateOne substringToIndex:4],[dateOne substringWithRange:range],[dateOne substringFromIndex:6],dateTwo];
    }else{
        str = [NSString stringWithFormat:@"%@.%@.%@-%@.%@.%@",[dateOne substringToIndex:4],[dateOne substringWithRange:range],[dateOne substringFromIndex:6],[dateTwo substringToIndex:4],[dateTwo substringWithRange:range],[dateTwo substringFromIndex:6]];
    }
    self.timetitle.text = str;
}
- (void)CleanTraditionSecView{
    UIView *msgview = [[UIView alloc]initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, 28)];
    msgview.backgroundColor = [UIColor colorWithHexString:@"FFE6CB"];
    [self addSubview:msgview];
    
    UIImageView *icon = [[UIImageView alloc]init];
    icon.image = [UIImage imageNamed:@"文字惊叹提示"];
    [msgview addSubview:icon];
    [icon mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(msgview.mas_centerY);
        make.left.equalTo(msgview.mas_left).offset(14);
        make.width.mas_equalTo(14);
        make.height.mas_equalTo(14);
    }];
    
    UILabel *msglab = [[UILabel alloc]init];
    msglab.textColor = [UIColor colorWithHexString:@"FF9C2A"];
    msglab.font = [UIFont fontWithName:@"PingFang-SC-Regular" size:12];
    msglab.text = @"请核对身份证信息以便确认无误";
    [msgview addSubview:msglab];
    [msglab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(icon.mas_centerY);
        make.left.equalTo(icon.mas_right).offset(6);
    }];
    UIView *cardView = [[UIView alloc]initWithFrame:CGRectMake(0, 28, SCREEN_WIDTH, 238)];
    cardView.backgroundColor = [UIColor whiteColor];
    [self addSubview:cardView];
    
    self.cardimg = [[UIImageView alloc]init];
    _cardimg.layer.masksToBounds = YES;
    _cardimg.layer.cornerRadius = 11;
    [cardView addSubview:_cardimg];
    [_cardimg mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(cardView.mas_top).offset(15);
        make.bottom.equalTo(cardView.mas_bottom).offset(-15);
        make.centerX.equalTo(cardView.mas_centerX);
        make.width.mas_equalTo(SCREEN_WIDTH - 46);
    }];
    
    UIView *infoview = [[UIView alloc]init];
    infoview.layer.masksToBounds = YES;
    infoview.layer.cornerRadius = 11;
    infoview.backgroundColor = [UIColor whiteColor];
    [self addSubview:infoview];
    [infoview mas_makeConstraints:^(MASConstraintMaker *make) {
        make.width.mas_equalTo(SCREEN_WIDTH - 28);
        make.top.equalTo(cardView.mas_bottom).offset(10);
        make.centerX.equalTo(cardView.mas_centerX);
        make.height.mas_equalTo(234);
    }];
    
    UILabel *subnametitle = [[UILabel alloc]init];
    subnametitle.textColor = [UIColor colorWithHexString:@"666666"];
    subnametitle.font = [UIFont fontWithName:@"PingFang-SC-Medium" size:14];
    subnametitle.text = @"姓名";
    [infoview addSubview:subnametitle];
    [subnametitle mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(infoview.mas_top).offset(20);
        make.left.equalTo(infoview.mas_left).offset(31);
        make.height.mas_equalTo(13);
    }];
    self.nametitle = [[UITextField alloc]init];
    _nametitle.textColor = [UIColor colorWithHexString:@"333333"];
    _nametitle.font = [UIFont fontWithName:@"PingFang-SC-Medium" size:16];
    _nametitle.textAlignment = NSTextAlignmentCenter;
    [infoview addSubview:_nametitle];
    [_nametitle mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.equalTo(infoview.mas_right);
        make.centerY.equalTo(subnametitle.mas_centerY);
        make.width.mas_equalTo(122);
    }];
    
    UIView *line = [[UIView alloc]init];
    line.backgroundColor = [UIColor colorWithHexString:@"EEEEEE"];
    [infoview addSubview:line];
    [line mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(infoview.mas_left);
        make.right.equalTo(infoview.mas_right);
        make.height.mas_equalTo(1);
        make.top.equalTo(subnametitle.mas_bottom).offset(20);
    }];
    
    UILabel *subsex = [[UILabel alloc]init];
    subsex.textColor = [UIColor colorWithHexString:@"666666"];
    subsex.font = [UIFont fontWithName:@"PingFang-SC-Medium" size:14];
    subsex.text = @"性别";
    [infoview addSubview:subsex];
    [subsex mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(line.mas_bottom).offset(15);
        make.left.equalTo(infoview.mas_left).offset(31);
        make.height.mas_equalTo(13);
    }];
    
    self.sextitle = [[UITextField alloc]init];
    _sextitle.textColor = [UIColor colorWithHexString:@"333333"];
    _sextitle.font = [UIFont fontWithName:@"PingFang-SC-Medium" size:16];
    _sextitle.textAlignment = NSTextAlignmentCenter;
    [infoview addSubview:_sextitle];
    [_sextitle mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.equalTo(self.nametitle.mas_centerX);
        make.centerY.equalTo(subsex.mas_centerY);
        make.width.mas_equalTo(40);
        make.height.mas_equalTo(50);
    }];
    
    UILabel *subcardtitle = [[UILabel alloc]init];
    subcardtitle.textColor = [UIColor colorWithHexString:@"666666"];
    subcardtitle.font = [UIFont fontWithName:@"PingFang-SC-Medium" size:14];
    subcardtitle.text = @"身份证号";
    [infoview addSubview:subcardtitle];
    [subcardtitle mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(subsex.mas_bottom).offset(25);
        make.left.equalTo(infoview.mas_left).offset(31);
        make.height.mas_equalTo(13);
    }];
    
    self.cardtitle = [[UITextField alloc]init];
    _cardtitle.textColor = [UIColor colorWithHexString:@"333333"];
    _cardtitle.font = [UIFont fontWithName:@"PingFang-SC-Medium" size:16];
    [infoview addSubview:_cardtitle];
    [_cardtitle mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(subcardtitle.mas_bottom);
        make.left.equalTo(infoview.mas_left).offset(31);
        make.height.mas_equalTo(25);
    }];
    
    UILabel *subtimetitle = [[UILabel alloc]init];
    subtimetitle.textColor = [UIColor colorWithHexString:@"666666"];
    subtimetitle.font = [UIFont fontWithName:@"PingFang-SC-Medium" size:14];
    subtimetitle.text = @"有效期限";
    [infoview addSubview:subtimetitle];
    [subtimetitle mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.cardtitle.mas_bottom).offset(25);
        make.left.equalTo(infoview.mas_left).offset(31);
        make.height.mas_equalTo(13);
    }];
    
    self.timetitle = [[UITextField alloc]init];
    _timetitle.textColor = [UIColor colorWithHexString:@"333333"];
    _timetitle.font = [UIFont fontWithName:@"PingFang-SC-Medium" size:16];
    [infoview addSubview:_timetitle];
    [_timetitle mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(subtimetitle.mas_bottom);
        make.left.equalTo(infoview.mas_left).offset(31);
        make.height.mas_equalTo(25);
    }];
    self.SureButton = [[UIButton alloc]init];
    [self.SureButton addTarget:self action:@selector(toSureOrNext:) forControlEvents:UIControlEventTouchUpInside];
    self.SureButton.layer.masksToBounds = YES;
    self.SureButton.layer.cornerRadius = 6;
    self.SureButton.backgroundColor = [UIColor colorWithHexString:@"0CA6F0"];
    [self.SureButton setTitle:@"下一步" forState:UIControlStateNormal];
    self.SureButton.titleLabel.font = [UIFont fontWithName:@"PingFang-SC-Regular" size:18];
    [self.SureButton setTitleColor:[UIColor colorWithHexString:@"ffffff"] forState:UIControlStateNormal];
    [self addSubview:self.SureButton];
    [self.SureButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.equalTo(self.mas_centerX);
        make.top.equalTo(infoview.mas_bottom).offset(60);
        make.width.mas_equalTo(SCREEN_WIDTH - 48);
        make.height.mas_equalTo(49);
    }];
    
}
- (void)toSureOrNext:(UIButton *)button{
    if (self.nametitle.text.length > 0) {
        if (self.sextitle.text.length > 0) {
            if (self.cardtitle.text.length > 0) {
                if (self.timetitle.text.length > 0) {
                    if (self.toSureBlock) self.toSureBlock(@{@"name":self.nametitle.text,@"sex":self.sextitle.text,@"card":self.cardtitle.text,@"time":self.timetitle.text});
                }else{
                    [SVPManager showErrorWithTitle:@"未获取到有效期限"];
                }
            }else{
                [SVPManager showErrorWithTitle:@"未获取到身份证号码"];
            }
        }else{
            [SVPManager showErrorWithTitle:@"未获取到性别"];
        }
    }else{
        [SVPManager showErrorWithTitle:@"未获取到姓名"];
    }
}


@end
